package cn.iocoder.yudao.module.member.dal.mysql.auth;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.auth.vo.MemberShopAuthPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.auth.MemberAuthDO;
import cn.iocoder.yudao.module.member.dal.dataobject.auth.MemberShopAuthDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 会员认证店铺 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface MemberShopAuthMapper extends BaseMapperX<MemberShopAuthDO> {
    default PageResult<MemberShopAuthDO> selectPage(MemberShopAuthPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MemberShopAuthDO>()
                .eqIfPresent(MemberShopAuthDO::getMemberId, reqVO.getMemberId())
                .eqIfPresent(MemberShopAuthDO::getStatus, reqVO.getStatus())
                .likeIfPresent(MemberShopAuthDO::getShopName, reqVO.getShopName())
                .betweenIfPresent(MemberShopAuthDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberShopAuthDO::getId));
    }
}
